package com.huawei.appgallery.search.ui.card;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.huawei.appgallery.foundation.ui.framework.cardframe.bean.BaseCardBean;
import com.huawei.appgallery.search.ui.cardbean.SearchWapLinkCardBean;
import com.huawei.appgallery.search.ui.widget.TagTextView;
import o.cgz;
import o.chy;
import o.cuv.a;
import o.cuv.b;
import o.dof;
import o.eqx;
import o.evx;

public class SearchWapLinkCard extends cgz {
    private TextView ˊ;
    private View ˋ;
    private TagTextView ˎ;
    private ImageView ˏ;
    private TextView ॱ;
    private View ᐝ;

    public SearchWapLinkCard(Context context) {
        super(context);
    }

    public cgz ˏ(View view) {
        view.findViewById(b.ᐝॱ).setVisibility(8);
        this.ˊ = (TextView) view.findViewById(b.ʾ);
        this.ˏ = (ImageView) view.findViewById(b.ˊˊ);
        this.ॱ = (TextView) view.findViewById(b.ʻॱ);
        this.ˎ = (TagTextView) view.findViewById(b.ͺ);
        this.ˋ = view.findViewById(b.ॱˎ);
        this.ᐝ = view.findViewById(b.ˏॱ);
        ʽ(view);
        return this;
    }

    public void ˎ(BaseCardBean baseCardBean) {
        super.ˎ(baseCardBean);
        if (baseCardBean instanceof SearchWapLinkCardBean) {
            SearchWapLinkCardBean searchWapLinkCardBean = (SearchWapLinkCardBean) baseCardBean;
            this.ˊ.setText(searchWapLinkCardBean.ˊ());
            CharSequence ॱ = searchWapLinkCardBean.ॱ();
            String ʽ = searchWapLinkCardBean.ʽ();
            String ˋʻ = searchWapLinkCardBean.ˋʻ();
            if (dof.ॱ(ॱ)) {
                this.ॱ.setVisibility(8);
            } else {
                this.ॱ.setVisibility(0);
                this.ॱ.setText(ॱ);
            }
            if (!dof.ॱ(ˋʻ)) {
                this.ˎ.setData(ʽ, ˋʻ, dof.ॱ(ʽ) ? 0 : (int) this.ʼॱ.getResources().getDimension(a.ॱॱ));
            } else if (dof.ॱ(ʽ)) {
                this.ˎ.setVisibility(8);
            } else {
                this.ˎ.setVisibility(0);
                this.ˎ.setText(ʽ);
            }
            eqx.ˏ(this.ˏ, searchWapLinkCardBean.ॱˌ(), "image_default_icon");
        }
        if (ˊᐝ()) {
            this.ˋ.setVisibility(0);
        } else {
            this.ˋ.setVisibility(8);
        }
    }

    public void ॱ(final chy o_chy) {
        if (this.ᐝ != null) {
            this.ᐝ.setOnClickListener(new evx(this) {
                final /* synthetic */ SearchWapLinkCard ˋ;

                public void ˋ(View view) {
                    if (o_chy != null) {
                        o_chy.ˏ(this.ˋ.ˋᐝ(), this.ˋ);
                    }
                }
            });
        }
    }

    public boolean ˊᐝ() {
        if (this.ˊᐝ == null || this.ˊᐝ.ॱㆍ()) {
            return false;
        }
        return true;
    }
}
